#include <semaphore.h>
#include <bits/stdc++.h>
#include <unistd.h>
#include "Semathore.hxx"
#include <semaphore>
using namespace std;

Sem g_sem;
counting_semaphore cnt(1);
void Print()
{
    while(1)
    {
        sleep(1);
        g_sem.Get();
        cout<<123456789<<"@&#!@()"<<endl;
        g_sem.Push();
    }
}

void Print2()
{
    while(1)
    {
        sleep(1);
        cnt.acquire();
        cout<<123456789<<"@&#!@()"<<endl;
        cnt.release();
    }
}
int main()
{
    g_sem.Push();
    thread t1(Print2);
    thread t2(Print2);
    thread t3(Print2);
    thread t4(Print2);
    t1.join();
    t2.join();
    t3.join();
    t4.join();
    return 0;
}